'use strict';



/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {


    const { router, controller } = app;

    let { prefix } = app.config.apiServer;

    const mobileRedirect = app.middleware.mobileRedirect();


    let pcRouter = [

        '/login',
        '/order-management',
        '/no-authority',
        '/my-order-history',
        '/bankroll-management',
        '/profile', 
        '/customer-list',
        '/order-history' ,
        '/withdraw-audit',
        '/all-order',
        '/readme'
    ]

    pcRouter.forEach((value) => {
        router.get(value, mobileRedirect, controller.pc.index);
    })

    router.get('/', mobileRedirect, controller.pc.home)
    router.get('/mobile/', controller.mobile.index);



    router.post(`${prefix}/user/uploadFile`, controller.zinvest.uploadFile);

    router.get(`${prefix}/user/captcha.png`, controller.zinvest.captcha);

    router.all(`${prefix}/**`, controller.zinvest.forward);



};


